home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
pcplus2.zip
/
HOST.ASP
< prev
next >
Wrap
Text File
|
1988-01-01
|
12KB
|
409 lines
;*************************************************************************
;* HOST.ASP (C) 1987 DATASTORM TECHNOLOGIES, INC. *
;* *
;* A sample ASPECT script file for PROCOMM PLUS to illustrate the use *
;* of various ASPECT commands (and provide a way to consistently and *
;* easily invoke HOST mode). *
;* *
;*************************************************************************
goto begin
;
; Frequently called subroutines should be placed at the beginning of
; an ASPECT file for maximum efficiency.
;
;****************************************;
;* statbox: Fill in the status window. *;
;****************************************;
statbox:
fatsay 8 35 15 "%-30s" s5
fatsay 9 35 15 "%-30s" s4
if zero n3
atsay 12 35 15 "Immediate"
else
atoi s3 n0
fatsay 12 35 15 "%s:%02d " s2 n0
endif
if not zero n1
atsay 13 35 15 "Enabled "
else
atsay 13 35 15 "Disabled"
endif
if zero n2
atsay 14 35 15 "Just exit "
else
atsay 14 35 15 "Exit to DOS"
endif
return
;***********************************;
;* begin: Logical starting place. *;
;***********************************;
begin:
gosub init ; You should go customize 'init'
gosub mainmenu ; display the main menu
top: ; We come here after each key
gosub statbox ; alsways show the stat box
assign s1 "Which one ? "
atsay 20 7 79 s1
locate 20 19
curon
keyget s1
switch s1
case "A"
help
endcase
case "Q"
goto done
endcase
case "S"
gosub setime
endcase
case "B"
goto beginhst
endcase
case "V"
dir "*.*"
endcase
case "D"
gosub setdl
endcase
case "H"
gosub help
endcase
case "U"
gosub setul
endcase
case "L"
atsay 20 7 79 "Press Enter and then Alt-P"
locate 20 37
get s1 0
help
endcase
case "C" ; toggle call back flag
if zero n1
inc n1
else
dec n1
endif
endcase
case "E" ; toggle quit all flag
if zero n2
inc n2
else
dec n2
endif
endcase
default
endcase
endswitch
goto top
;end main loop
done:
clear
exit
;********* end of main routine *********;
;*************************************;
;* beginhst: Executes HOST command. *;
;*************************************;
beginhst:
if not zero n3 ; if delay is on, suspend
clear 0
atoi s3 n0
fatsay 20 15 14 "Suspended until: %s:%02d (ESC to abort)" s2 n0
suspend until s2 s3
endif
clear
host
if not zero n1
goto callback
endif
if zero n2
exit
else
quit
endif
;************************************;
;* chk_range: verify numeric entry *;
;* input: n0 - value to verify *;
;* n8 - lower limit *;
;* n9 - upper limit *;
;* (n8 ≤ n9 !!) *;
;* output: global 'SUCCESS' set *;
;* if: n8 ≤ n0 ≤ n9. *;
;* reset otherwise. *;
;************************************;
chk_range:
assign s0 "!" ; (n0 is in the range)
strcmp s0 "!" ; set success to true
if LT n0 n8
goto chk_no
endif
if GT n0 n9
goto chk_no
endif
return ; and return
chk_no:
strcmp s0 "?" ; set success to false
return ; and return
;************************************;
;* setime: set suspend until time. *;
;************************************;
setime:
assign s1 "What hour (00-23, <CR> for immediate) ? "
atsay 20 7 79 s1
atget 20 47 78 2 s1
strcpy s2 s1
strcat s1 "Z"
strcmp s1 "Z"
if success ; if Enter, then
init n3 0 ; turn off delay flag
return ; and exit
endif
atoi s2 n0 ; else verify that entry
init n8 1 ; is from 0
init n9 23 ; to 23
gosub chk_range ; using function: chk_range
if not success
sound 440 50
pause 2
goto setime
endif ; else we have a starting time
assign s1 "What min. (00-59, <CR> for 00) ? "
atsay 20 7 79 s1
atget 20 47 78 2 s1
strcpy s3 s1
strcat s1 "Z"
strcmp s1 "Z"
if not success ; if not default, verify entry
atoi s3 n0
init n8 0 ; is from 0
init n9 59 ; to 23
gosub chk_range ; using function: chk_range
if not success
sound 440 50
pause 2
goto setime
endif ; else we have a starting time
else
strcpy s3 "00"
endif
init n3 1 ; turn on delay flag
return
;************************************;
;* help: display help screen. *;
;************************************;
help:
box 4,30, 17,67 31
atsay 6 34 30 "No help is currently available"
atsay 8 34 30 " (Press any key)"
keyget s0
;
; Restore the status window
;
box 4,30, 17,67 7
atsay 6 38 112 " - Current settings - "
atsay 7 30 7 "╩"
atsay 8 30 7 "─ ─ "
atsay 9 30 7 "─ ─ "
atsay 10 30 7 "─ ─ "
atsay 12 30 7 "─ ─ "
atsay 13 30 7 "─ ─ "
atsay 14 30 7 "─ ─ "
atsay 15 30 7 "╦"
atsay 10 35 15 "(See status line)"
return
;************************************;
;* callback: *;
;************************************;
callback:
transmit "Enter phone number: "
rget s1 25
transmit "^M^MIs this correct: "
transmit s1
transmit " (Y/N/Q)?"
rget s0 1
switch s0
case "Q"
goto quitcb
endcase
case "Y"
init n0 5 ; number of redial attempts
goto havenum
endcase
default
goto callback
endcase
endswitch
havenum:
transmit "^MAfter I disconnect, verify that your modem will answer^M"
pause 3
hangup
tryagain
pause 2
mdial s1
pause 2
if not connected
dec n0
if LT n0 5
goto tryagain
else
goto begin
endif
endif
terminal
quitcb:
transmit "^Mreturning to host mode"
goto begin
return
;************************************;
;* setul: set upload directory. *;
;************************************;
setul:
gosub getdir
if success
strcpy s4 s1
set dldir s4
chdir s5
endif
return
;************************************;
;* setdl: set download directory. *;
;************************************;
setdl:
gosub getdir
if success
strcpy s5 s1
endif
return
blankmsg:
assign s0 " " ; restore msg line
fatsay 20 7 79 "%60s" s0
return
;****************************************;
;* getdir: general getdir routine. *;
;* input: none *;
;* output: *;
;* prompts user for directory name. *;
;* if valid entry, then *;
;* SUCCESS = true and s1 = dir. *;